x86 hvm: Do not check-and-fail on in_atomic() in hvm_copy().
authorKeir Fraser <keir@xen.org>
Fri, 14 Jan 2011 15:18:02 +0000 (15:18 +0000)
committerKeir Fraser <keir@xen.org>
Fri, 14 Jan 2011 15:18:02 +0000 (15:18 +0000)
Stub this out for 4.0, as PV-on-HVM drivers hit this case when
performing grant-table hypercalls. Grant-table code currently accesses
guest memory under bug per-domain lock. The test in hvm_copy() is not
necessary until the xenpaging implementation is more complete, which
will not now be until after 4.1.0.

Signed-off-by: Keir Fraser <keir@xen.org>
xen/arch/x86/hvm/hvm.c

index 62c018fa4462fa63deefd27f822cd6aaa91656ec..1a89bfb575caa7227290cbdce513d72c44a2f1c5 100644 (file)
@@ -1993,12 +1993,21 @@ static enum hvm_copy_result __hvm_copy(
     char *p;
     int count, todo = size;
 
+    /*
+     * XXX Disable for 4.1.0: PV-on-HVM drivers will do grant-table ops
+     * such as query_size. Grant-table code currently does copy_to/from_guest
+     * accesses under the big per-domain lock, which this test would disallow.
+     * The test is not needed until we implement sleeping-on-waitqueue when
+     * we access a paged-out frame, and that's post 4.1.0 now.
+     */
+#if 0
     /*
      * If the required guest memory is paged out, this function may sleep.
      * Hence we bail immediately if called from atomic context.
      */
     if ( in_atomic() )
         return HVMCOPY_unhandleable;
+#endif
 
     while ( todo > 0 )
     {